//
//  WYJNavgationController.swift
//  MySinaWeibo
//
//  Created by eastriver on 16/10/4.
//  Copyright © 2016年 believewilliam. All rights reserved.
//

import UIKit

class WYJBaseNavgationController: UINavigationController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
    }
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        super.pushViewController(viewController, animated: animated)
        if childViewControllers.count > 1 {
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "返回", imageName: "navigationbar_back_withtext", target: self, action: #selector(back))
            viewController.hidesBottomBarWhenPushed = true
        }
        
        
        
    }
    func back() {
        let _ = self.popViewController(animated: true)
    }
    
}
